<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/preserves/preserves.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/preserves/preserves.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'PreserveId',
                footer: "Foots",
                cnName: '保养记录',
                name: 'preserves/preserves',
                url: "/VehicleService/api/preserves/",
                sortName: "CreateTime"
            });
            const editFormFields = ref({"PreserveTitle":"","CarLicense":"","PreserveMoney":"","Mileage":"","PreserveLastTime":"","MileageLast":"","PreserveTime":"","PreserveProject":"","PreserveRemark":""});
            const editFormOptions = ref([[{"title":"保养标题","required":true,"field":"PreserveTitle"}],
                              [{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"}],
                              [{"title":"保养金额","field":"PreserveMoney","type":"decimal"}],
                              [{"title":"当前里程数","field":"Mileage","type":"decimal"}],
                              [{"title":"上次保养日期","field":"PreserveLastTime"}],
                              [{"title":"上次保养里程数","field":"MileageLast","type":"decimal"}],
                              [{"title":"当前保养日期","field":"PreserveTime","type":"datetime"}],
                              [{"title":"保养项目","field":"PreserveProject"}],
                              [{"title":"备注","field":"PreserveRemark"}]]);
            const searchFormFields = ref({"CarLicense":"","PreserveTime":""});
            const searchFormOptions = ref([[{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"},{"title":"当前保养日期","field":"PreserveTime","type":"datetime"}]]);
            const columns = ref([{field:'PreserveId',title:'保养记录Id',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'PreserveTitle',title:'保养标题',type:'string',width:110,require:true,align:'left',sort:true},
                       {field:'CarLicense',title:'车牌号',type:'string',bind:{ key:'车牌号下拉框',data:[]},width:110,align:'left'},
                       {field:'PreserveMoney',title:'保养金额',type:'decimal',width:110,align:'left'},
                       {field:'Mileage',title:'当前里程数',type:'decimal',width:110,align:'left'},
                       {field:'PreserveLastTime',title:'上次保养日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'MileageLast',title:'上次保养里程数',type:'decimal',width:110,align:'left'},
                       {field:'PreserveTime',title:'当前保养日期',type:'date',width:150,align:'left',sort:true},
                       {field:'PreserveProject',title:'保养项目',type:'string',width:110,align:'left'},
                       {field:'PreserveRemark',title:'备注',type:'string',width:110,align:'left'},
                       {field:'IsDelete',title:'逻辑删除',type:'int',width:110,hidden:true,align:'left'},
                       {field:'CreateName',title:'创建人',type:'string',width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',sort:true,width:150,align:'left',sort:true},
                       {field:'UpdateName',title:'修改人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'UpdateTime',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
